package com.guchenbo.study.mvc.servlet31.springboot.jar;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Component
public class SpringHandlerInterceptor extends HandlerInterceptorAdapter {
    @Resource
    private StudyService studyService;

    protected static final Logger log = LoggerFactory.getLogger(SpringHandlerInterceptor.class);

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
                    throws Exception {
        log.info("in SpringHandlerInterceptor");
        studyService.demo();
        return true;
    }
}
